package com.bwie.controller;

import com.bwie.pojo.TbOrder;
import com.bwie.service.AddOrderService;
import com.bwie.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Title:
 * @BelongProjecet month0617
 * @BelongPackage com.bwie.controller
 * @Description:
 * @Copyright 研发一部
 * @Author: Mr.yan
 * @Date: 2024/6/17 13:06
 * @Version V1.0
 */
@RestController
@RequestMapping("/order/add")
public class AddOrderController {

    @Autowired
    private AddOrderService addOrderService;

    /**
     * @Description: //创建订单信息
     * @Auther: yanxingru
     * @Date: 2024/6/17 13:09
     * @param:
     * @param tbOrder
     * @return com.bwie.utils.R
     */
    @PostMapping("/addOrder")
    public R addOrder(
            @RequestBody TbOrder tbOrder,
            @RequestHeader("token") String token
            ){
        return addOrderService.addOrder(tbOrder,token);
    }


    /**
     * @Description: //查找所有商品
     * @Auther: yanxingru
     * @Date: 2024/6/17 15:37
     * @param:
     * @return com.bwie.utils.R
     */
    @PostMapping("/goodsList")
    public R goodsList(){
        return addOrderService.goodsList();
    }


}
